<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="Content-Language" content="zh-CN"><link href="stylesheet.css" media="all" rel="stylesheet" type="text/css">
<title>pg_attrdef</title>
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head><body class="SECT1">
<div>
<table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><th colspan="5" align="center" valign="bottom">PostgreSQL 8.2.3 中文文档</th></tr>
<tr><td width="10%" align="left" valign="top"><a href="catalog-pg-amproc.html" accesskey="P">后退</a></td><td width="10%" align="left" valign="top"><a href="catalogs.html">快退</a></td><td width="60%" align="center" valign="bottom">章43. 系统表</td><td width="10%" align="right" valign="top"><a href="catalogs.html">快进</a></td><td width="10%" align="right" valign="top"><a href="catalog-pg-attribute.html" accesskey="N">前进</a></td></tr>
</table>
<hr align="LEFT" width="100%"></div>
<div class="SECT1"><h1 class="SECT1"><a name="CATALOG-PG-ATTRDEF">43.6. <tt class="STRUCTNAME">pg_attrdef</tt></a></h1><a name="AEN62208"></a>
<p><tt class="STRUCTNAME">pg_attrdef</tt> 表存储字段缺省值。字段的主要信息存放在 <tt class="STRUCTNAME">pg_attribute</tt>(见下文)。只有明确声明一个缺省值(该表何时创建或字段何时增加)的字段在这里有行。</p>
<div class="TABLE"><a name="AEN62213"></a>
<p><b>表43-6. <tt class="STRUCTNAME">pg_attrdef</tt> 字段</b></p>
<table border="1" class="CALSTABLE"><col><col><col><col>
<thead>
<tr><th>名字</th><th>类型</th><th>引用</th><th>描述</th></tr>
</thead>
<tbody>
<tr><td><tt class="STRUCTFIELD">adrelid</tt></td><td><tt class="TYPE">oid</tt></td><td><tt class="LITERAL"><a href="catalog-pg-class.html"><tt class="STRUCTNAME">pg_class</tt></a>.oid</tt></td><td>这个字段所属的表</td></tr>
<tr><td><tt class="STRUCTFIELD">adnum</tt></td><td><tt class="TYPE">int2</tt></td><td><tt class="LITERAL"><a href="catalog-pg-attribute.html"><tt class="STRUCTNAME">pg_attribute</tt></a>.attnum</tt></td><td>字段数目</td></tr>
<tr><td><tt class="STRUCTFIELD">adbin</tt></td><td><tt class="TYPE">text</tt></td><td>&nbsp;</td><td>字段缺省值的内部表现形式</td></tr>
<tr><td><tt class="STRUCTFIELD">adsrc</tt></td><td><tt class="TYPE">text</tt></td><td>&nbsp;</td><td>人类可读的缺省值的内部表现形式</td></tr>
</tbody>
</table>
</div>
<p><tt class="STRUCTFIELD">adsrc</tt> 是历史遗留，最好不要使用它，因为它并未跟踪可能影响缺省值表现形式的外部变化。反编译 <tt class="STRUCTFIELD">adbin</tt> 字段(比如，用 <code class="FUNCTION">pg_get_expr</code>)是更好的显示缺省值的方法。</p>
</div>
<div>
<hr align="LEFT" width="100%">
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="33%" align="left" valign="top"><a href="catalog-pg-amproc.html" accesskey="P">后退</a></td><td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">首页</a></td><td width="33%" align="right" valign="top"><a href="catalog-pg-attribute.html" accesskey="N">前进</a></td></tr>
<tr><td width="33%" align="left" valign="top"><tt class="STRUCTNAME">pg_amproc</tt></td><td width="34%" align="center" valign="top"><a href="catalogs.html" accesskey="U">上一级</a></td><td width="33%" align="right" valign="top"><tt class="STRUCTNAME">pg_attribute</tt></td></tr>
</table>
</div>
</body></html>